﻿using GN.Pay.TradeChannel;
using GN.Pay.TradeChannel.Configure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GN.Pay.TradeChannel.WeiXin
{
    /// <summary>
    /// 微信扫码支付
    /// </summary>
    [Serializable]
    public class WeiXinConfigure : ATradeChannelConfigure<WeiXinConfigureInfo>
    {
        /// <summary>
        /// 
        /// </summary>
        public WeiXinConfigure(IChannel channel) 
            : base(channel)
        {

        }

        /// <summary>
        /// 
        /// </summary>
        protected override string NotifyControllerName
        {
            get
            {
                return "WeiXin";
            }
        }       

        public override string GetOrderQueryErrorMessage(string code)
        {
            throw new NotImplementedException();
        }

        public override string GetPayErrorMessage(string code)
        {
            throw new NotImplementedException();
        }

        public override string GetRefundErrorMessage(string code)
        {
            throw new NotImplementedException();
        }

        protected override void SaveCheck(WeiXinConfigureInfo configureInfo)
        {
            CheckNotNull(configureInfo, nameof(configureInfo));
            CheckNotNullOrWhite(configureInfo.AppId, nameof(configureInfo.AppId));
            CheckNotNullOrWhite(configureInfo.Key, nameof(configureInfo.Key));
            CheckNotNullOrWhite(configureInfo.AccountId, nameof(configureInfo.AccountId));
            if (configureInfo.IsSupportRefund)
            {
                CheckNotNullOrWhite(configureInfo.RefundCretRawBase64, nameof(configureInfo.RefundCretRawBase64));
            }
        }
    }
}
